<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  const a = {
    valueOf() {
      return 'valueOf';
    },
    toString() {
      return 'toString';
    },
    [Symbol.toPrimitive]() {
      return 'toPrimitive';
    }
  };

  const b = {
    valueOf() {
      return 'valueOf';
    },
    toString() {
      return 'toString';
    }
  };

  const c = {
    valueOf() {
      return 'valueOf';
    }
  };

  console.log(`${a}`);  // toPrimitive
  console.log(`${b}`);  // toString
  console.log(`${c}`);  // valueOf
</script>
</body>
</html>
